package com.huijy.management.service.impl;

import java.util.List;

import com.huijy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huijy.management.mapper.FeedbackMapper;
import com.huijy.management.domain.Feedback;
import com.huijy.management.service.IFeedbackService;

/**
 * 建议反馈Service业务层处理
 *
 * @author lishuwen
 * @date 2021-11-23
 */
@Service
public class FeedbackServiceImpl implements IFeedbackService {
    @Autowired
    private FeedbackMapper feedbackMapper;

    /**
     * 查询建议反馈
     *
     * @param id 建议反馈主键
     * @return 建议反馈
     */
    @Override
    public Feedback selectFeedbackById(Long id) {
        return feedbackMapper.selectFeedbackById(id);
    }

    /**
     * 查询建议反馈列表
     *
     * @param feedback 建议反馈
     * @return 建议反馈
     */
    @Override
    public List<Feedback> selectFeedbackList(Feedback feedback) {
        return feedbackMapper.selectFeedbackList(feedback);
    }

    /**
     * 新增建议反馈
     *
     * @param feedback 建议反馈
     * @return 结果
     */
    @Override
    public int insertFeedback(Feedback feedback) {
        feedback.setCreateTime(DateUtils.getNowDate());
        return feedbackMapper.insertFeedback(feedback);
    }

    /**
     * 修改建议反馈
     *
     * @param feedback 建议反馈
     * @return 结果
     */
    @Override
    public int updateFeedback(Feedback feedback) {
        return feedbackMapper.updateFeedback(feedback);
    }

    /**
     * 批量删除建议反馈
     *
     * @param ids 需要删除的建议反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedbackByIds(Long[] ids) {
        return feedbackMapper.deleteFeedbackByIds(ids);
    }

    /**
     * 删除建议反馈信息
     *
     * @param id 建议反馈主键
     * @return 结果
     */
    @Override
    public int deleteFeedbackById(Long id) {
        return feedbackMapper.deleteFeedbackById(id);
    }
}
